<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>InerHtml</title>
        <script type="text/javascript">
        function getDiv(){                
        var polje= document.getElementById("p1");
        alert(polje.innerHTML);        
        }
        </script>
    </head>
    <body>
        <div id="d1">
            <a href="http://www.google.com">Link</a>
            <p id ="p1">
                paragraf 1
            </p>
        </div>
        <button type="button" onclick="getDiv();">         
            Button
        </button>
    </body>
</html>